<?php if($state):?>
<script>
ajax_go_to_pay_ = function(){
	wx.chooseWXPay({
		 timestamp: <?php echo $jsApiParameters['timestamp']?>,
		 nonceStr: '<?php echo $jsApiParameters['nonceStr']?>', 
		 package: '<?php echo $jsApiParameters['package']?>', 
		 signType: '<?php echo $jsApiParameters['signType']?>',
		 paySign: '<?php echo $jsApiParameters['paySign']?>',
		 success: function (res) {
		        // 支付成功后的回调函数
		       location.href = '<?php echo $return?>';
		 }
	});
}
</script>
<?php else:?>
<script>
ajax_go_to_pay_ = function(){
    alert('<?php echo $msg?>');
};
</script>
<?php endif;?>